/*
 * @Description: 积分抵扣规则
 * @Date: 2022-12-09 14:00:11
 * @Author: lizhiqiang
 */
import { IntegralDeductionRule } from "@/types/api";
import { get, post } from "@/utils/request";
/**
 * 获取积分抵扣规则列表
 */
export const GetIntegralExchangeRuleList = ( params: IntegralDeductionRule ) => {
    return post( "/integral-service/integral/merchantDeductionRule/list", params )
}
/**
 * 获取积分抵扣规则详情
 * @param pkAccountDc 
 * @returns 
 */
export const GetIntegralExchangeRule = ( id: string ) => {
    return get( `/integral-service/integral/merchantDeductionRule/info/${ id }` )
}
/**
 * 保存积分抵扣规则
 * @param params 
 * @returns 
 */
export const SaveIntegralExchangeRule = ( params: IntegralDeductionRule ) => {
    return post( "/integral-service/integral/merchantDeductionRule/save", params )
}
/**
 * 修改积分抵扣规则
 * @param params 
 * @returns 
 */
export const UpdateIntegralExchangeRule = ( params: IntegralDeductionRule ) => {
    return post( "/integral-service/integral/merchantDeductionRule/update", params )
}
/**
 * 删除积分抵扣规则
 * @param params 
 * @returns 
 */
export const DeleteIntegralExchangeRule = ( params: Array<string> ) => {
    return post( "/integral-service/integral/merchantDeductionRule/deleteBatch",params)
}
/**
 * 查询积分抵扣规则
 * @param params 
 * @returns 
 */
export const QueryIntegralExchangeRule = ( params: {
    accountTitleCode:string,
    pkAccountTitle:string,
    pkMerchantInfo:string
} ) => {
    return post("/integral-service/integral/merchantDeductionRule/queryDeductionRule",params)
}

/**
 * 获取平台积分抵扣规则列表
 */
export const getPlatformIntegralRuleList = ( params: IntegralDeductionRule ) => {
    return post( "/integral-service/integral/platformDeductionRule/list", params )
}
/**
 * 新增平台积分抵扣规则列表
 */
export const addPlatformIntegralRuleList = ( params: IntegralDeductionRule ) => {
    return post( "/integral-service/integral/platformDeductionRule/save", params )
}
/**
 * 编辑平台积分抵扣规则列表
 */
export const editPlatformIntegralRuleList = ( params: IntegralDeductionRule ) => {
    return post( "/integral-service/integral/platformDeductionRule/update", params )
}
/**
 * 编辑平台积分抵扣规则列表
 */
export const getPlatformIntegralRuleById = ( id: string ) => {
    return get( `/integral-service/integral/platformDeductionRule/info/${id}`, null )
}
/**
 * 查询全平台商家与平台积分的统一抵扣规则
 */
export const getPlatformDeductionRule = () => {
    return get( `/integral-service/integral/platformDeductionRule/queryConfig`, null )
}